home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource for Source: C/C++
/
Resource for Source - C-C++.iso
/
codelib4
/
v_06_08
/
v6n8049b.txt
< prev
next >
Wrap
Text File
|
1995-11-01
|
2KB
|
60 lines
/* hr_clear.c - Clear high resolution display page from start of page
* to end of page by filling with the bit pattern for the specified
* color c. Two bytes, one word, are filled on each access since
* adjacent bytes of the same color have the low 7 bits inverted.
* Integers must be unsigned. Returns void.
*
* Environment: Apple II, Aztec c65 V1.05B
* Programmer: Don Strayer
* Date: 15-Jun-88
*/
#include <hr_apple2.h,d2>
hr_clear( sop , eop , c )
int sop; /* start of page */
int eop; /* end of page */
int c; /* color */
{ int *wa; /* pointer to word address */
int pat; /* bit pattern for that word */
switch ( c ) /* set pattern for specified color */
{ case HR_BLACK:
{ pat = 0; /* black - binary zeroes */
break;
}
case HR_PURPLE: /* odd columns on, high order off */
{ pat = 21802; /* binary 0101010100101010 */
break;
}
case HR_BLUE: /* even columns on, high order off */
{ pat = 10837; /* binary 0010101001010101 */
break;
}
case HR_GREEN: /* odd columns on, high order on */
{ pat = 54698; /* binary 1101010110101010 */
break;
}
case HR_ORANGE: /* even columns on, high order on */
{ pat = 43733; /* binary 1010101011010101 */
break;
}
case HR_WHITE:
{ pat = 65535; /* white - binary ones */
break;
}
default:
{ pat = 0; /* default black - binary zeroes */
break;
}
}
for ( wa = sop; wa < eop; ++wa ) /* fill the page from sop to eop */
*wa = pat;
return();
}